#
# Read in two binary files and xor them
#
# @author Jonathan Walsh
#

import os,sys
import array

if len(sys.argv) != 4:
    print "USAGE: write_as_binary.py <f1> <f2> <out>"
    sys.exit(1)

f1=bytearray(open(sys.argv[1],'rb').read())
f2=bytearray(open(sys.argv[2],'rb').read())

for i in range(len(f1)):
    f1[i] ^= f2[i]

open(sys.argv[3],'wb').write(f1)
